<!DOCTYPE html>
<style>
div {
  width: min-content;
  border: 5px blue solid;
}
</style>
<div>0123&shy;45</div>
